% Funcion para calcular el ECM 
function e = ecm(N,img,imgF)

e = 0;
n = sqrt(N);
for i = 1:n
	for j = 1:n
		pOrig = double(img(i,j));
		pFilt = double(imgF(i,j));
		e = e + (pOrig-pFilt)^2;
	end
end

N = double(N);
e = e/N;